package com.dgut.usermodule.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

@Entity
@Table(name="t_log")
@DynamicUpdate(true)
public class Log {
	private Long logId; //日志id
	private String userName; //用户名
	private String moduleName; //模块名称
	@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
	private Date date; //操作时间
	private String operate; //方法名
	private String params;//传入的参数
	private String ip; //操作的ip地址
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getLogId() {
		return logId;
	}
	public String getUserName() {
		return userName;
	}
	
	public String getModuleName() {
		return moduleName;
	}
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss")
	public Date getDate() {
		return date;
	}
	public String getOperate() {
		return operate;
	}
	public String getParams() {
		return params;
	}
	public String getIp() {
		return ip;
	}
	public void setLogId(Long logId) {
		this.logId = logId;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public void setModuleName(String moduleName) {
		this.moduleName = moduleName;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public void setOperate(String operate) {
		this.operate = operate;
	}
	public void setParams(String params) {
		this.params = params;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	@Override
	public String toString() {
		return "Log [LogId=" + logId + ", userName=" + userName + ", moduleName=" + moduleName + ", date=" + date
				+ ", operate=" + operate + ", params=" + params + ", ip=" + ip + "]";
	}
	
}
